package com.csy.admin.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.csy.admin.entity.SysRole;
import com.csy.admin.mapper.SysRoleMapper;
import com.csy.admin.service.SysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author csy
 * @since 2018-09-11
 */
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements SysRoleService {

    @Autowired
    private SysRoleMapper sysRoleMapper;

    /**
     * 根据账号获取用户角色
     * @param userCode
     * @return
     */
    @Override
    public List<SysRole> findRolesByUserCode(String userCode) {
        List<SysRole> roles = sysRoleMapper.selectRoleByUserCode(userCode);
        return roles;
    }
}
